﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<ContactManager.Controllers.GroupFormViewModel>" %>
<%@ Import Namespace="ContactManager.Helpers" %>

 <% using (Html.BeginForm()) {%>
        <%= Html.ValidationSummary(true) %>
        
        <fieldset>
            <legend>Fields</legend>
            
              <div class="editor-label">
                <%= Html.LabelFor(model => model.ContactGroup.Id) %>
            </div>
            <div class="editor-field">
             <%= Html.ConditionalTextBoxFor(model => model.ContactGroup.Id).MakeReadOnlyIf(() => Model.ContactGroup.Id.ToString().Length > 0) %>
                
                <%= Html.ValidationMessageFor(model => model.ContactGroup.Id)%>
            </div>
                      
            <div class="editor-label">
                <%= Html.LabelFor(model => model.ContactGroup.Name) %>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.ContactGroup.Name)%>
                <%= Html.ValidationMessageFor(model => model.ContactGroup.Name)%>
            </div>
            
            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>

    <% } %>
